<template>
  <adv-button-emit-code-editor
		v-model="curBindVal"
		v-bind="allCompAttrs"
		v-on="allBindEvents"
	>
	<template v-for="(slotVal, slotName, index) in $slots" :key="slotName" #[slotName]>
		<slot :name="slotName" v-if="!allCompAttrs[getSlotMetaKeyBySlotName(slotName)]"></slot>
	</template>
</adv-button-emit-code-editor>
</template>
<script>
export default {
  inheritAttrs: false,
  name: "DismensionAdvButtonEmitCodeEditor"
};
</script>
<script setup>
import { computed,ref } from "vue";

import useComponentAttrs, {
  embeddedAtomicCompProps,
} from "../../useComponentAttrs";
import useComponentEvents from "../../useComponentEvents";

const props = defineProps({
  ...embeddedAtomicCompProps,
});



//组件所有属性的默认值映射
const compAttrsKeyDefaultValueMapping = {
    "style": {},
    "btnText": undefined,
    "btnType": undefined,
    "pickedDefaultCodeAdviceVal": undefined,
    "codeAdviceOptions": [],
    "lang": "javascript",
    "textWrapperConfig": {},

}

const { curBindVal, containerType, allCompAttrs } = useComponentAttrs({
  props,
  compAttrsKeyDefaultValueMapping,
});

const {allBindEvents,getBindSlotEvents} = useComponentEvents(props, curBindVal);

const allSlotUiConfigInPanel = [];
const getSlotMetaKeyBySlotName = (slotName) => {
  const matchedUiConfig = allSlotUiConfigInPanel.find(
    (el) => el.slotConfig.slotName === slotName
  );
  if (matchedUiConfig) {
    return matchedUiConfig.key;
  } else {
    return "";
  }
};
</script>
